package com.example.demo;

import java.io.FileOutputStream;
import java.io.IOException;
import java.util.HashMap;

/**
 * @Author: hwq
 * @Date: 2020/2/11 19:44
 * @Version 1.0
 */
public class Book {


    public static void main(String[] args) throws IOException {
        ///网址
        String o = "https://www.biqugetv.com/37_37495/23798945.html";
        //文件路径
        String filename = "D:/1-500`.txt";
        try (FileOutputStream fos = new FileOutputStream(filename, true)) {
            for (int j = 1; j < 512; j++) {
                if(o==null){
                    System.out.println("写入完成!");
                    return;
                }
                o = OkHttpUtil.get(o, new HashMap<>(), fos,j);
                System.out.println("写入" + j + "章");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }


    }

}
